﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Abs.Core.DAL.EntityFramework
{
    internal abstract class EntityRepository<T> : Repository<T>
    {
        internal EntityRepository()
        {
            this.AbsContext = new AbsContext();
        }//end of internal EntityRepository()

        //Properties
        internal AbsContext AbsContext { get; set; }

        //CRUD methods
        public abstract override bool Create(T item);
        public abstract override IList<T> SelectAll();
        public abstract override T Select(object[] id);
        public abstract override bool Update(T item);
        public abstract override bool Delete(object[] id);

        public override void Dispose()
        {
            if(this.AbsContext != null)
                this.AbsContext.Dispose();
        }//end of public override void Dispose()
    }//end of internal class EntityRepository<T> : Repository<T>
}//end of namespace ABS.DAL.EntityFramework